import React, { useEffect } from 'react'
import axios from 'axios'
export default function ProxyCom() {
  //useEffect
  useEffect(() => {
    //声明一个函数
    let getData = async() => {
      //针对 / 开头的 url , 请求时会与页面 url 的协议, 域名和端口进行拼接, 形成完整的 url 再发送请求
      // let res = await axios.get('/dev/goods');
      // console.log(res);

      //头条接口
      // let url = '/toutiao/hot-event/hot-board/?origin=toutiao_pc&_signature=_02B4Z6wo00f01yaVq0wAAIDCLLNw5Xwara8msa.AAKw63hc4fE5nDtg816VUz2v6AJ43-pN91drlcrAiwUyn.16J12PgMYtqQFqdshRteL1JIe6zVHEazV7MRiQQWRTEV-mA1k2LzNNMaGQX03';
      //发送请求
      // let res = await axios.get(url);

      //bilibili的接口https://api.live.bilibili.com
      let url = '/bili/room/v1/Index/getShowList';
      //发送请求
      let res = await axios.get(url);
      console.log(res);
      
    }
    getData();
  }, [])
  
  return (
    <div>ProxyCom</div>
  )
}
